cmake_minimum_required(VERSION 3.4.1)
project(lame-mp3)

# 设置C标准
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_STANDARD_REQUIRED ON)

# 包含头文件目录
include_directories(libmp3lame)

# 收集LAME源文件（更精确的方式）
file(GLOB LAME_SOURCES
        libmp3lame/*.c
        libmp3lame/*.cpp
)

# 添加编译选项忽略特定警告
add_compile_options(
        -Wno-absolute-value
        -Wno-shift-negative-value
        -Wno-tautological-pointer-compare
)

add_library(mp3lame-lib
        SHARED
        net_qiujuer_lame_Lame.cpp
        ${LAME_SOURCES})

find_library(log-lib log)

# 只链接必要的log库
target_link_libraries(mp3lame-lib ${log-lib})